[IA64] fix gmfn_to_mfn
authorIsaku Yamahata <yamahata@valinux.co.jp>
Fri, 9 May 2008 09:40:58 +0000 (18:40 +0900)
committerIsaku Yamahata <yamahata@valinux.co.jp>
Fri, 9 May 2008 09:40:58 +0000 (18:40 +0900)
gmfn_to_mfn should return INVALID_MFN when the gpfn is I/O page.
Using PV on HVM, I got the following error message.

(XEN) /xen/include/asm/mm.h:181:d2 Error pfn 2: rd=f000000007fb4080, od=0000000000000000, caf=0000000000000000, taf=0000000000000000
(XEN) memory.c:165:d2 Bad page free for domain 2

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
xen/arch/ia64/xen/mm.c

index 7f82eece617686c6d92e9183365affb38ac84e27..1b3612065ee76e27b4f70cbd861b4241b5c0b051 100644 (file)
@@ -494,6 +494,10 @@ gmfn_to_mfn_foreign(struct domain *d, unsigned long gpfn)
        if (!pte) {
                panic("gmfn_to_mfn_foreign: bad gpfn. spinning...\n");
        }
+
+       if ((pte & _PAGE_IO) && is_hvm_domain(d))
+               return INVALID_MFN;
+
        return ((pte & _PFN_MASK) >> PAGE_SHIFT);
 }